package com.ies.ieschool.client.module.academic.view.data;

import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.fields.DataSourceIntegerField;
import com.smartgwt.client.data.fields.DataSourceTextField;

public class StudentData extends DataSource {
	
	private static StudentData instance = null;  
	  
    public static StudentData getInstance() {  
        if (instance == null) {  
            instance = new StudentData("studentDS");  
        }  
        return instance;  
    }
    public StudentData(String id) {  
    	  
        setID(id);  
        setRecordXPath("/List/student");  
        DataSourceIntegerField pkField = new DataSourceIntegerField("pk");  
        pkField.setHidden(true);  
        pkField.setPrimaryKey(true);  
  
        DataSourceTextField studentIDField = new DataSourceTextField("studentID");  
        studentIDField.setRequired(true);  
  
        DataSourceTextField studentNameField = new DataSourceTextField("studentName");  
        studentNameField.setRequired(true);  
        
        
  
        DataSourceTextField AmountField = new DataSourceTextField("amount");  
        AmountField.setRequired(true);  
          
        setFields(pkField, studentIDField, studentNameField, AmountField);  
  
        setDataURL("ds/test_data/student.data.xml");  
        setClientOnly(true);  
    }
}
